﻿using Himp.Outpatient;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Application.Dtos;
using Volo.Abp.DependencyInjection;

namespace Himp.Platform.GraphQLs
{
    /// <summary>
    /// 门诊就诊
    /// </summary>
    public class OtpMdtrtsQuery : ISingletonDependency
    {
        /// <summary>
        /// 
        /// </summary>
        private readonly IServiceProvider _serviceProvider;

        /// <summary>
        /// 
        /// </summary>
        /// <param name="serviceProvider"></param>
        public OtpMdtrtsQuery(IServiceProvider serviceProvider)
        {
            _serviceProvider = serviceProvider;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PagedResultDto<OtpMdtrtRecDto>> GetOtpMdtrtRecListAsync(OtpMdtrtRecInput input)
        {
            var otpMdtrtRecService = _serviceProvider.GetService<IOtpMdtrtRecService>();

            return await otpMdtrtRecService.GetListAsync(input);
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PagedResultDto<OtpRxTypeDto>> GetOtpRxTypeListAsync(OtpRxTypeInput input)
        {
            var otpRxTypeService = _serviceProvider.GetService<IOtpRxTypeService>();

            return await otpRxTypeService.GetListAsync(input);
        }

        /// <summary>
        /// 获取门诊处方记录列表
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PagedResultDto<OtpRxRecDto>> GetOtpRxRecListAsync(OtpRxRecInput input)
        {
            var otpRxRecService = _serviceProvider.GetService<IOtpRxRecService>();

            return await otpRxRecService.GetListAsync(input);
        }

        /// <summary>
        /// 获取门诊处方记录明细列表
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PagedResultDto<OtpRxRecDetlDto>> GetOtpRxRecDetlListAsync(OtpRxRecDetlInput input)
        {
            var otpRxRecDetlService = _serviceProvider.GetService<IOtpRxRecDetlService>();

            return await otpRxRecDetlService.GetListAsync(input);
        }

        /// <summary>
        /// 获取门诊处方记录
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<OtpRxRecDto> GetOtpRxRecAsync(Guid id)
        {
            var otpRxRecService = _serviceProvider.GetService<IOtpRxRecService>();

            return await otpRxRecService.GetAsync(id);
        }

        /// <summary>
        /// 获取门诊申请单
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PagedResultDto<OtpAppyFormDto>> GetOtpAppyFormListAsync(OtpAppyFormInput input)
        {
            var otpAppyFormService = _serviceProvider.GetService<IOtpAppyFormService>();

            return await otpAppyFormService.GetListAsync(input);
        }

        /// <summary>
        /// 获取门诊申请单明细
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        public async Task<PagedResultDto<OtpAppyFormDetlDto>> GetOtpAppyFormDetlListAsync(OtpAppyFormDetlInput input)
        {
            var otpAppyFormDetlService = _serviceProvider.GetService<IOtpAppyFormDetlService>();

            return await otpAppyFormDetlService.GetListAsync(input);
        }
    }
}
